{extend name="template/base" /}
{block name="content"}
<div class="page-container">
    <form class="mb-20" method="get" action="{:\\think\\Url::build($Request.action)}">
        <input type="text" class="input-text" style="width:250px" placeholder="产品id" name="sales_id" value="{$Request.param.sales_id}">
        <input type="text" class="input-text" style="width:250px" placeholder="订单号" name="order_id" value="{$Request.param.order_id}">
        <input type="text" class="input-text" style="width:250px" placeholder="预订人" name="booking_people_name" value="{$Request.param.booking_people_name}">
        <input type="text" class="input-text" style="width:250px" placeholder="预订人手机" name="booking_people_phone" value="{$Request.param.booking_people_phone}">

        <input type="text" class="input-text Wdate  mb-5" autocomplete="off" style="width:250px" placeholder="下单日期" name="ctime" value="{$Request.param.ctime}" {literal} onfocus="WdatePicker({dateFmt: 'yyyy-MM-dd'})" {/literal} >
        <input type="text" class="input-text Wdate  mb-5" autocomplete="off" style="width:250px" placeholder="出行日期" name="date1" value="{$Request.param.date1}" {literal} onfocus="WdatePicker({dateFmt: 'yyyy-MM-dd'})" {/literal} >
        <input type="text" class="input-text" style="width:250px" placeholder="skuid" name="skuid" value="{$Request.param.skuid}">
        <input type="text" class="input-text" style="width:250px" placeholder="线路" name="route_title" value="{$Request.param.route_title}">


        <div class="select-box" style="width:250px">
            <select name="order_status" class="select">
                <option value="">选择订单状态</option>
                {volist name=":config('order_status')" id="order_statu"}
                <option value="{$key}">{$order_statu}</option>
                {/volist}
            </select>
        </div>
        <div class="select-box" style="width:250px">
            <select name="isrefund" class="select">
                <option value="">选择是否退款</option>
                <option value="0">不退款</option>
                <option value="1">退款</option>
            </select>
        </div>
        <div class="select-box" style="width:250px">
            <select name="platform" class="select">
                <option value="">选择平台</option>
                {foreach $platform as $pvo}
                <option value="{$pvo.platform_name}">{$pvo.name}</option>
                {/foreach}
            </select>
        </div>
        <!--<div class="select-box" style="width:250px">-->
        <!--<select name="allot_end" class="select">-->
        <!--<option value="">选择是否已分配完成</option>-->
        <!--<option value="0">未分配完成</option>-->
        <!--<option value="1">已分配完成</option>-->
        <!--</select>-->
        <!--</div>-->
        <input type="text" class="input-text" style="width:250px" placeholder="备注" name="booking_people_remark" value="{$Request.param.booking_people_remark}">
        <button type="submit" class="btn btn-success" id="realname_btn" name=""><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
    </form>


    <div class="cl pd-5 bg-1 bk-gray">
        <span class="l">
            {tp:menu menu="add,forbid,resume,delete,recyclebin" /}
        </span>
        <span class="r pt-5 pr-5">
            共有数据 ：<strong>{$count ?? '0'}</strong> 条
        </span>
    </div>
    <?php use think\Db;?>
    <table class="table table-border table-bordered table-hover table-bg mt-20">
        <thead>
        <tr class="text-c">
            {include file="th" /}
            <th width="">平台</th>
            <th width="">备注</th>
            <th width="70">操作</th>
        </tr>
        </thead>
        <tbody>
        {volist name="list" id="vo"}
        <tr class="text-c">
            {include file="td" /}
            <!--新增备注-20190121-->
            <td class="f-14">
                <?php
                    if($platform){
                        foreach($platform as $k=>$v){
                if($v['platform_name'] == $vo['platform']){
                $plate = $v['name'];
                }
                }
                }else{
                $plate = '';
                }
                ?>
                <?php echo $plate;?>
            </td>
            <td>{$vo.booking_people_remark}</td>
            <td class="f-14">
                <!--<a href="javascript:;" onclick="agree('{$vo.id}')" class="label label-success radius" title="退款">退款</a>-->
                {$vo.status|show_status=$vo.id}
                {tp:menu menu='sedit' /}
                {tp:menu menu='sdelete' /}
                {php}
                $exceptional_orders=Db::name("exceptional_order")->where('oid',$vo['id'])->where('solve',false)->select();
                {/php}
                {if condition="$exceptional_orders"}
                <a title="编辑选项" href="javascript:;" onclick="layer_open('编辑选项','/admin/order/exceptional/oid/{$vo.id}')" style="text-decoration:none" class="ml-5 label label-warning radius">异常信息</a>
                {/if}
            </td>
        </tr>
        {/volist}
        </tbody>
    </table>
    <div class="page-bootstrap">{$page ?? ''}</div>
</div>

{/block}
{block name="script"}
<script type="text/javascript" src="__LIB__/My97DatePicker/WdatePicker.js"></script>
<script>
    function agree(id) {
        $.ajax({
            type: 'POST',
            url: "/admin/order/refund?id="+id,
            data: null,
            success: function (re){
                layer.msg(re.msg, {
                    time: 2000, //2s后自动关闭
                },function () {
                    //关闭后刷新
                    location.reload();
                });
            },
        });
    }
    $(function () {
        $("[name='isrefund']").find("[value='{$Request.param.isrefund}']").attr("selected", true);
        $("[name='order_status']").find("[value='{$Request.param.order_status}']").attr("selected", true);
        $("[name='platform']").find("[value='{$Request.param.platform}']").attr("selected", true);
    })
</script>
{/block}
